package com.yunsom.testdemo.design.state;

/**
 * @author Xbao
 * @description 状态模式
 * @date 2022/6/22 13:13
 */
public class TestState {

  public static void main(String[] args) {
    Context context = new Context();

    StartState startState = new StartState();
    startState.doAction(context);
    System.out.println(context.getState());


    StopState stopState = new StopState();
    stopState.doAction(context);
    System.out.println(context.getState());
  }
}
